/* Copyright 2009 Sony Mathew, Minneapolis MN. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
package com.xsm.gwt.widgets.client;

import com.google.gwt.user.client.ui.SimplePanel;

/**
 * Add this Demo to your EntryPoint's Root to see the demo.
 * 
 * Scroll down in the build() method to see AxisPanel being used in a single
 *  expression to layout your interactive widgets (like buttons, textboxes etc.).
 * <br>
 * Interactive widgets as they come into existence are placed above the layout
 *  or in a separate method with their appropriate Listeners.
 *      
 * @author Sony Mathew
 */
public class AxisPanelBorderLayoutDemoPanel extends SimplePanel {

    /**
     * Build this panel.
     */
    public AxisPanelBorderLayoutDemoPanel() {
        
        //Sample contents.
        
        AxisPanel myNorthContentPanel = new AxisPanel()
            .x().border(1)
                .x("North").border(1).q()
                .x("North").border(1).q()
                .x("North").border(1).q()
                .x("North").border(1).q()
                .x("North").border(1).q()
                .x("North").border(1).q()
                .x("North").border(1).q()
                .x("North").border(1).q()
                .x("North").border(1).q()
                .x("North").border(1).q()
            .q();

        AxisPanel myEastContentPanel = new AxisPanel()
            .y().border(1)        
                .x("East").border(1).q()
                .x("East").border(1).q()
                .x("East").border(1).q()
                .x("East").border(1).q()
                .x("East").border(1).q()
                .x("East").border(1).q()
                .x("East").border(1).q()
                .x("East").border(1).q()
                .x("East").border(1).q()
                .x("East").border(1).q()
            .q();
        
        AxisPanel myCenterContentPanel = new AxisPanel()
            .y().border(1)        
                .x("Center").border(1).q()
                .x("Center").border(1).q()
                .x("Center").border(1).q()
                .x("Center").border(1).q()
                .x("Center").border(1).q()
                .x("Center").border(1).q()
                .x("Center").border(1).q()
                .x("Center").border(1).q()
                .x("Center").border(1).q()
                .x("Center").border(1).q()
            .q();
        
        AxisPanel myWestContentPanel = new AxisPanel()
            .y().border(1)        
                .x("West").border(1).q()
                .x("West").border(1).q()
                .x("West").border(1).q()
                .x("West").border(1).q()
                .x("West").border(1).q()
                .x("West").border(1).q()
                .x("West").border(1).q()
                .x("West").border(1).q()
                .x("West").border(1).q()
                .x("West").border(1).q()
            .q();
        
        AxisPanel mySouthContentPanel = new AxisPanel()
            .x().border(1)
                .x("South").border(1).q()
                .x("South").border(1).q()
                .x("South").border(1).q()
                .x("South").border(1).q()
                .x("South").border(1).q()
                .x("South").border(1).q()
                .x("South").border(1).q()
                .x("South").border(1).q()
                .x("South").border(1).q()
                .x("South").border(1).q()
            .q();
        
        //Border Layout of the sample contents.
        
        AxisPanel p = new AxisPanel()
            .y().width("100%")
                .x(myNorthContentPanel).css("north").q()
                .x().width("100%")
                    .y(myWestContentPanel).css("west").q()
                    .y(myCenterContentPanel).css("center").width("100%").align(0,0).q()
                    .y(myEastContentPanel).css("east").width("100%").align(1,0).q()                    
                    .q()
                .x(mySouthContentPanel).css("south").q()
                .q();
                
        setWidget(p);                
    }
    
}
    
